package exercise9;

import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Pane;
import javafx.stage.Stage;

import java.io.File;

public class Exercise14_03 extends Application {

    public static void main(String[] args) {
        launch(args);
    }

    @Override
    public void start(Stage primaryStage) {
        int card_1;
        int card_2;
        int card_3;

        card_1= (int) (Math.random() * 55);
        card_2= (int) (Math.random() * 55);
        card_3= (int) (Math.random() * 55);


        String filename_1="file:image"+ File.separator+"card"+File.separator+
                "veryhuo.com_pkp_"+card_1+".jpg";

        String filename_2="file:image"+ File.separator+"card"+File.separator+
                "veryhuo.com_pkp_"+card_2+".jpg";
        String filename_3="file:image"+ File.separator+"card"+File.separator+
                "veryhuo.com_pkp_"+card_3+".jpg";

        ImageView imageView_1=new ImageView(filename_1);
        ImageView imageView_2=new ImageView(filename_2);
        ImageView imageView_3=new ImageView(filename_3);

        Pane pane=new HBox(10);
        pane.setPadding(new Insets(5,5,5,5));

        pane.getChildren().add(imageView_1);
        pane.getChildren().add(imageView_2);
        pane.getChildren().add(imageView_3);

        Scene scene=new Scene(pane);

        primaryStage.setTitle("扑克牌随机选择");
        primaryStage.setScene(scene);
        primaryStage.show();
    }

}
